import request from '@/utils/request';

// 群裂变-列表
export function getGroupFissionList(data: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/list',
        method: 'POST',
        data
    });
}
// 是否开启微信支付 "is_open_wxpay": 1 //是否开启微信支付：0未开启，1开启了
export function getOpenWxpay(data?: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/pay-status',
        method: 'POST',
        data
    });
}
// 群裂变-新建
export function createGroupFission(data: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/create',
        method: 'POST',
        data
    });
}
// 群裂变-编辑
export function editGroupFission(data: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/edit',
        method: 'POST',
        data
    });
}
// 群裂变-查看
export function lookGroupFission(data: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/info',
        method: 'POST',
        data
    });
}
// 群裂变-提前开始/结束
export function advanceGroupFission(data: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/advance',
        method: 'POST',
        data
    });
}
// 群裂变-删除/批量删除
export function delGroupFission(data: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/del',
        method: 'POST',
        data
    });
}
// 群裂变-下载/批量下载
export function downloadGroupFission(data: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/download',
        method: 'POST',
        data
    });
}
// 群裂变-统计信息
export function statsBaseGroupFission(data: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/stats-base',
        method: 'POST',
        data
    });
}
//群裂变-统计邀请记录
export function statsInviterGroupFission(data: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/stats-inviter',
        method: 'POST',
        data
    });
}
// 群裂变-统计邀请记录导出
export function statsInviterExportGroupFission(data: any) {
    return request({
        url: '/scrm-api/console/market/groupFission/stats-inviter-export',
        method: 'POST',
        data
    });
}
// 群裂变1.0删除接口
export function groupFissionDel(data: any) {
    return request({
        url: '/scrm-api/console/market/group-fission/del',
        method: 'POST',
        data,
        noNeedLoading: true
    });
}
// 群裂变1.0提前结束
export function groupFissionEnd(data: any) {
    return request({
        url: '/scrm-api/console/market/group-fission/early-end',
        method: 'POST',
        data,
        noNeedLoading: true
    });
}
// 群裂变1.0列表
export function groupFissionList(data: any) {
    return request({
        url: '/scrm-api/console/market/group-fission/list',
        method: 'POST',
        data,
        noNeedLoading: true
    });
}

// 群裂变1.0导入兑奖码验证
export function importExChangeCode(data: any) {
    return request({
        url: '/scrm-api/console/market/group-fission/import/exchange-code',
        method: 'POST',
        data
    });
}

/**
 * 群裂变1.0创建活动
 * @param data 创建的入参params
 * @returns any
 */
export function createGroupFissionNew(data: any) {
    return request({
        url: '/scrm-api/console/market/group-fission/create',
        method: 'POST',
        data
    });
}

/**
 * 群裂变1.0获取群裂变详情
 * @param data 活动id
 * @returns any
 */
export function getGroupFissionInfoById(data: any) {
    return request({
        url: '/scrm-api/console/market/group-fission/info',
        method: 'POST',
        data
    });
}

/**
 * 群裂变1.0获取群裂变编辑
 * @param data 创建的入参params + 活动id等
 * @returns any
 */
export function editGroupFissionInfo(data: any) {
    return request({
        url: '/scrm-api/console/market/group-fission/update',
        method: 'POST',
        data
    });
}

// 群裂变数据分析——概览
export const overview = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/data-overview',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——折线图
export const trend = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/trend',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——折线图导出
export const trendExport = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/trend-export',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——用户列表
export const userList = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/member',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——用户列表导出
export const numberExport = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/member-export',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——裂变明细
export const fissionDetail = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/fission-detail',
        method: 'POST',
        data
    });
};

//  群裂变数据分析——用户列表限制
export const userLimit = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/limit',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——奖品数据
export const rewardList = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/reward',
        method: 'POST',
        data
    });
};
// 群列变数据分析——中奖数据
export const rewardRecord = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/reward-record',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——中奖列表导出
export const recordExport = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/reward-record-export',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——批量核销
export const batchVerifier = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/batch-verifier',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——单个核销
export const verifier = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/verifier',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——发放红包
export const sendRed = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/send-red',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——导入核销
export const importCode = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/import-code',
        method: 'POST',
        data
    });
};

// 群列表数据分析——导入核销模版
export const getTemp = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/get-temp',
        method: 'POST',
        data
    });
};

// 群裂变数据分析——查询接口
export const getTempList = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/get-temp-list',
        method: 'POST',
        data
    });
};

// 活动推广
export const getLink = (data: any, noNeedLoading = false) => {
    return request({
        url: '/scrm-api/console/market/group-fission/get-link',
        method: 'POST',
        data,
        noNeedLoading
    });
};

// 设置推广链接
export const setLink = (data: any) => {
    return request({
        url: '/scrm-api/console/market/group-fission/set-link',
        method: 'POST',
        data
    });
};

// 推广生成链接
export const generateShare = (data: any, noNeedLoading = false) => {
    return request({
        url: '/scrm-api/console/market/group-fission/generate-share',
        method: 'POST',
        data,
        noNeedLoading
    });
};

// 推广二维码生成
export const generateQrcode = (data: any, noNeedLoading = false) => {
    return request({
        url: '/scrm-api/generate-qrcode',
        method: 'POST',
        data,
        noNeedLoading
    });
};
